FROM registry.cn-chengdu.aliyuncs.com/manbu/java:8u302

ARG JAR_FILE
ENV jar_file=${JAR_FILE}

RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone
EXPOSE 8081
WORKDIR /opt/
COPY ./target/${JAR_FILE} /opt/
CMD java -XX:MaxRAMPercentage=90.0 -XX:MinRAMPercentage=60.0 \
    -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/mnt/  \
    -jar ${jar_file}
